//
//package com.yuke.cloud.service.omc.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cache.annotation.EnableCaching;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.RedisConnectionFactory;
//import org.springframework.data.redis.connection.RedisPassword;
//import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
//import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
//import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
//import org.springframework.data.redis.listener.ChannelTopic;
//import org.springframework.data.redis.listener.RedisMessageListenerContainer;
//
//import javax.annotation.Resource;
//import java.time.Duration;
//
///**
// * 用于用户下单后，设定的时间内如果没有支付则取消订单，时间在Quartz.second中设置
// */
//@Configuration
//@EnableCaching
//public class RedisConfiguration {
//    //-------------------------------pub/sub-----------------------------------
//    @Resource
//    private KeyExpiredListener keyExpiredListener;
//
//    @Bean
//    public ChannelTopic expiredTopic() {
//        return new ChannelTopic("__keyevent@0__:expired");
//    }
//
//    @Bean
//    public RedisMessageListenerContainer redisMessageListenerContainer(
//            @Autowired RedisConnectionFactory redisConnectionFactory) {
//        RedisMessageListenerContainer redisMessageListenerContainer = new RedisMessageListenerContainer();
//        redisMessageListenerContainer.setConnectionFactory(redisConnectionFactory);
//        redisMessageListenerContainer.addMessageListener(keyExpiredListener, expiredTopic());
//        return redisMessageListenerContainer;
//    }
//
//
//}
//
